import {getNoticeList,addNotice,deleteNotice,searchNotice,updateNotice} from "@/api/notice"

const state = {noticeList:null};
const getters = {
  noticeList: (status) => status.noticeList
}
const mutations = {
  setNociteList(state, data) {
    state.noticeList = data;
  },
}
const actions = {
  async getNoticeList({commit}, param) {
    const {data} = await getNoticeList(param);
    commit("setNociteList", data);
  },
  async searchNotice({commit}, param) {
    const {data} = await searchNotice(param);
    commit("setNociteList", data);
  },
  async addNotice({commit}, param) {
    return await addNotice(param);
  },
  async deleteNotice({commit}, param) {
    return await deleteNotice(param);
  },
  async updateNotice({commit}, param) {
    return await updateNotice(param);
  },
}

export default {state, getters, mutations, actions};

